package com.Ling.Thread.procuctorAndCustomer;

/**
 * File Name: Procutor
 * Date: 2020-06-28 11:20
 * Author: liangling
 * Description
 */
public class Procutor extends Thread{

    private prosuctPool prosuctPool;

    public Procutor(prosuctPool pool){
        this.prosuctPool = pool;
    }

    @Override
    public void run() {
        while (true){
            String name = (int)(Math.random()*100) +"号产品";
            product product = new product(name);
            System.out.println("生产了一件产品"+name);
            this.prosuctPool.push(product);

        }
    }
}
